package com.job.sun.HomeWork0717;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-18 13:51:46
 */
public class UseCalender {
    public static void main(String[] args) {
        //获取当前时间的日历对象
        Calendar now =Calendar.getInstance();
        System.out.println(now);

        int year=now.get(Calendar.YEAR);
        int month=now.get(Calendar.MONTH);
        int day=now.get(Calendar.DAY_OF_MONTH);

        System.out.println(year+month+day);


        now.add(Calendar.YEAR, -39);
        System.out.println(now);

        Date date=now.getTime();
        System.out.println(date);
    }
    }

